<?php
	$file_name=$_GET['filename'];
	require_once("../../utils/db.php");//链接信息\
	$link=connect();
	$benvid=$_GET['vid'];
	$sql="update fishvideo_video set yjl_downtimes=yjl_downtimes+1 where yjl_vid='{$benvid}'";
	echo $sql;
	if(!mysql_query($sql)){
		echo "更新失败！";
	}
	mysql_close($link);
	function download_by_path($path_name, $save_name){
         ob_end_clean();
         $hfile = fopen($path_name, "rb") or die("Can not find file: $path_name\n");
         Header("Content-type: application/octet-stream");
         Header("Content-Transfer-Encoding: binary");
         Header("Accept-Ranges: bytes");
         Header("Content-Length: ".filesize($path_name));
         Header("Content-Disposition: attachment; filename=\"$save_name\"");
         while (!feof($hfile)) {
            echo fread($hfile, 32768);
         }
         fclose($hfile);
    }
    download_by_path($file_name,"video");

?>